package com.sf.iisp.webservice.biz.impl;

import javax.annotation.Resource;
import javax.jws.WebService;


import com.esotericsoftware.minlog.Log;
import com.sf.iisp.BindingException;
import com.sf.iisp.bind.biz.BindingBiz;
import com.sf.iisp.bind.biz.UnbindingBiz;
import com.sf.iisp.webservice.biz.IBindPhoneWs;

@WebService(targetNamespace = "http://www.sf-express.com/novatar/wsdl", portName = "BindPhoneEndpoint",
        serviceName = "BindPhone", endpointInterface = "com.sf.iisp.webservice.biz.IBindPhoneWs")
public class BindPhoneWsImpl implements IBindPhoneWs {

    @Resource
    private UnbindingBiz unbindingBiz;

    @Resource
    BindingBiz bindingBiz;


    @Override
    public String bindPhoneByWs(String jsonInfo) {
        try {
            Log.info("webservice bind SGS jsonInfo ={}", jsonInfo);
            return bindingBiz.bind(jsonInfo);
        } catch (BindingException e) {
            Log.error(e.getMessage(), e);
            return "fail";
        }
    }

    @Override
    public String unbindPhoneByWs(String jsonInfo) {
        try {
            Log.info("webservice unbind SGS jsonInfo ={}", jsonInfo);
            return unbindingBiz.unbind(jsonInfo);
        } catch (BindingException e) {
            Log.error(e.getMessage(), e);
            return "fail";
        }
    }

}








